import Login from "@/views/login/login.vue"
import Home from "@/views/home/home.vue"

const routes = [
  {
    path: '/login',
    name: 'login',
    meta: {
      title: 'Login - 登录',
      hideInMenu: true
    },
    component: () => import('@/views/login/login.vue')
  },
  {
    path: '/',
    name: 'home',
    redirect: '/dashboard',
    component: Home,
    children: [
      {
        path: 'dashboard',
        name: '信息',
        meta: {
          icon: 'dashboard'
        },
        component: () => import('@/views/dashboard')
      }
    ]
  },

]

// 动态加载的菜单
const asyncRoutes = [
  {
    path: '/system',
    name: 'system',
    component: Home,
    children: [
      {
        path: 'menu',
        name: 'menu',
        meta: {
          title: '菜单管理',
          icon: 'el-icon-setting',
        },
        component: ()=> import('@/views/system/menu/home')
      },
      {
        path: 'admin',
        name: 'admin',
        meta: {
          title: '管理员',
          icon: 'el-icon-setting',
        },
        component: ()=> import('@/views/system/admin/home')
      },
      {
        path: 'promise',
        name: 'promise',
        meta: {
          title: '管理员',
          icon: 'el-icon-setting',
        },
        component: ()=> import('@/views/system/promise/home')
      },
    ]
  },
]

export {routes,asyncRoutes}